import { applyMiddleware, createStore } from 'redux';
import logger from 'redux-logger';
import rootReducer from './reducer';

/*
  学习目标：配置redux调试工具，
  步骤：
     1. 下包 redux-devtools-extension
     2.
     3. 装插件
     4. 重启观察效果
*/

import thunk from 'redux-thunk';
import { composeWithDevTools } from 'redux-devtools-extension';

// 2.  配置调试工具
const store = createStore(
  rootReducer,
  // 口诀：工具 -> 应用 -> 中间件
  composeWithDevTools(applyMiddleware(thunk, logger))
);

export default store;
